package hr.infomare.drrh.pojo;

// Generated 21.09.2011. 15:44:13 by Hibernate Tools 3.2.1.GA

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import budgetuserlibrary.gw.fmis.ibm.hr.infotypes.BudgetCommitmentStatusNotification;

/**
 * Budcommsg generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "BUDCOMMSG")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class Budcommsg implements java.io.Serializable {

	private int bcmsgid;

	private Reqmsg reqmsg;
	private String curlib;
	private String r95upr;
	private int r95god;
	private int r95rbr;
	private int typeres;
	private byte opt;
	private int duedate;
	private String completed;
	private String statnotty;
	private int refdocid;
	private byte status;
	private String user;
	private int datetime;
	private Date datetimews;
	private Date timews;

	public Budcommsg() {
	}

	@Id
	@Column(name = "BCMSGID", unique = true, nullable = false, precision = 9, scale = 0)
	public int getBcmsgid() {
		return this.bcmsgid;
	}

	public void setBcmsgid(int bcmsgid) {
		this.bcmsgid = bcmsgid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "REQMSGID")
	public Reqmsg getReqmsg() {
		return this.reqmsg;
	}

	public void setReqmsg(Reqmsg reqmsg) {
		this.reqmsg = reqmsg;
	}

	@Column(name = "CURLIB", nullable = false, length = 10)
	public String getCurlib() {
		return this.curlib;
	}

	public void setCurlib(String curlib) {
		this.curlib = curlib;
	}

	@Column(name = "R95UPR", nullable = false, length = 4)
	public String getR95upr() {
		return this.r95upr;
	}

	public void setR95upr(String r95upr) {
		this.r95upr = r95upr;
	}

	@Column(name = "R95GOD", nullable = false, precision = 4, scale = 0)
	public int getR95god() {
		return this.r95god;
	}

	public void setR95god(int r95god) {
		this.r95god = r95god;
	}

	@Column(name = "R95RBR", nullable = false, precision = 7, scale = 0)
	public int getR95rbr() {
		return this.r95rbr;
	}

	public void setR95rbr(int r95rbr) {
		this.r95rbr = r95rbr;
	}

	@Column(name = "TYPERES", nullable = false, precision = 1, scale = 0)
	public int getTyperes() {
		return this.typeres;
	}

	public void setTyperes(int typeres) {
		this.typeres = typeres;
	}

	@Column(name = "OPT", nullable = false, precision = 2, scale = 0)
	public byte getOpt() {
		return this.opt;
	}

	public void setOpt(byte opt) {
		this.opt = opt;
	}

	@Column(name = "DUEDATE", nullable = false, precision = 8, scale = 0)
	public int getDuedate() {
		return this.duedate;
	}

	public void setDuedate(int duedate) {
		this.duedate = duedate;
	}

	@Column(name = "COMPLETED", length = 1)
	public String getCompleted() {
		return completed;
	}

	public void setCompleted(String completed) {
		this.completed = completed;
	}

	@Column(name = "STATNOTTY", length = 50)
	public String getStatnotty() {
		return this.statnotty;
	}

	public void setStatnotty(String statnotty) {
		this.statnotty = statnotty;
	}

	@Column(name = "REFDOCID", nullable = false, precision = 9, scale = 0)
	public int getRefdocid() {
		return this.refdocid;
	}

	public void setRefdocid(int refdocid) {
		this.refdocid = refdocid;
	}

	@Column(name = "STATUS", nullable = false, precision = 2, scale = 0)
	public byte getStatus() {
		return this.status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	@Column(name = "USER", nullable = false, length = 10)
	public String getUser() {
		return this.user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	@Column(name = "DATETIME", nullable = false, precision = 8, scale = 0)
	public int getDatetime() {
		return this.datetime;
	}

	public void setDatetime(int datetime) {
		this.datetime = datetime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DATETIMEWS", length = 10)
	public Date getDatetimews() {
		return this.datetimews;
	}

	public void setDatetimews(Date datetimews) {
		this.datetimews = datetimews;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "TIMEWS", length = 8)
	public Date getTimews() {
		return this.timews;
	}

	public void setTimews(Date timews) {
		this.timews = timews;
	}

	public void postaviVrijednosti(byte status, Reqmsg reqMsg, Date dateTimeWS,
			BudgetCommitmentStatusNotification notificationResponse) {
		this.status = status;
		this.reqmsg = reqMsg;
		this.datetimews = dateTimeWS;
		this.timews = dateTimeWS;
		this.statnotty = notificationResponse.getCommitmentStatus() != null ? notificationResponse
				.getCommitmentStatus().name() : null;
	}
}